package com.lening.provider.controller.InternalWorkOrder;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lening.common.base.BaseController;
import com.lening.provider.dto.InternalWorkOrder.ErnalWorkOrderMainTableDTO;
import com.lening.provider.po.InternalWorkOrder.ErnalWorkOrderMainTablePO;
import com.lening.provider.service.InternalWorkOrder.ErnalWorkOrderMainTableService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.reactive.function.client.WebClient;


/**
 * @author 刘政华
 * @datetime 2024/6/5 11:35
 * @description 类对象
 */
@Slf4j
@RestController
@RequestMapping("ernalWorkOrderMainTables")
public class ErnalWorkOrderMainTableController extends BaseController<ErnalWorkOrderMainTablePO, ErnalWorkOrderMainTableDTO, ErnalWorkOrderMainTableService> {

    @Autowired(required = false)
    private WebClient webClient;

    @Autowired
    private ErnalWorkOrderMainTableService ernalWorkOrderMainTableService;

    @Override
    public Page<?> page(ErnalWorkOrderMainTableDTO ernalWorkOrderMainTableDTO) {
        return ernalWorkOrderMainTableService.ernalWorkList(ernalWorkOrderMainTableDTO);
    }

    @GetMapping("/count")//待处理内部工单
    public long getCount() {
        return ernalWorkOrderMainTableService.count();
    }

}
